<%--                                                                       --%>
<%-- Copyright (c) 2003 BroadVision, Inc.  All rights reserved.            --%>
<%--                                                                       --%>
<%-- This software is copyrighted. Under the copyright laws, this software --%>
<%-- may not be copied, in whole or in part, without prior written consent --%>
<%-- of BroadVision, Inc. or its assignees. This software is provided      --%>
<%-- under the terms of a license between BroadVision and the recipient,   --%>
<%-- and its use is subject to the terms of that license.                  --%>
<%--                                                                       --%>
<%-- This software may be protected by one or more U.S. and International  --%>
<%-- patents.  Certain applications of BroadVision One-To-One software are --%>
<%-- covered by U.S. patent 5,710,887.                                     --%>
<%--                                                                       --%>
<%-- TRADEMARKS: BroadVision and BroadVision One-To-One are registered     --%>
<%-- trademarks of BroadVision, Inc., in the United States and the         --%>
<%-- European Community, and are trademarks of BroadVision, Inc., in other --%>
<%-- countries.  The BroadVision logo, is a trademark of BroadVision,      --%>
<%-- Inc., in the United States and other countries. Additionally, IONA    --%>
<%-- and Orbix are trademarks of IONA Technologies, Ltd.  RSA, MD5, and    --%>
<%-- RC2 are trademarks of RSA Data Security, Inc.                         --%>
<%--                                                                       --%>

<%@ page import =  "java.util.*,
                    java.net.*,
                    com.broadvision.ssp.client.SspInstance"
%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<% 
String ctPath = request.getContextPath();
%>

<SCRIPT language="javascript">

function doCollabAction(prop){
  var theURL = "/cs/micrositeHome.do";
  var theParam = "?micrositeId=" + prop;
  var url = '<html:rewrite page="'+theURL+'" />'+theParam;
  var win = window.open(url,"","toolbar=0,scrollbars=yes,location=0,statusbar=0,height=500,width=500,left=50,top=50,resizable=yes,menubar=0");
}

</SCRIPT>

    <table class="zoneFive" width="100%" border="0" cellspacing="0" cellpadding="0" 
           summary="<bean:message bundle="appCommonRes" key="bp.process.processInstance.contentArea"/>">
      <tr>
        <td valign="top" width="100%">
          <div class="app_pageTitle"><bean:message bundle="appCommonRes" key="bp.process.processInstance.title"/>: 
            <bean:write name="processInstanceDetailView" property="customId"/>
          </div>
         
          <div class="app_pageSubtitle">
            <span class="left"><bean:write name="processInstanceDetailView" property="customId"/></span>
            <span class="right">
            <html:form method="post" action="/cs/processInstanceDiagram.do">
              <input type=hidden name='instanceOid' 
                value=<bean:write name="processInstanceDetailView" property="oid" /> >

              <input type="submit" class="titleButton" name="viewButton"
                value='<bean:message bundle="appCommonRes" key="button.viewDiagram"/>' >
            </html:form>
            </span>
          </div> 
       
          <logic:messagesPresent> 
	  <div class="blockWrap">
	    <div class="errorMessage"><html:errors/>
	  </div>
          </logic:messagesPresent>
          
          <table class="labelForm" border="0" cellspacing="0" cellpadding="0" 
                 summary="<bean:message bundle="appCommonRes" key="bp.process.processInstance.summary"/>"  width="100%">        
        
            <tr>
                <td valign="top" nowrap class="label" width="18%">
                  <bean:message bundle="appCommonRes" key="bp.process.processInstance.processName"/>:
                </td>                
                <td valign="top" wrap class="labelField" width="82%">
                    <bean:write  name="processInstanceDetailView" property="sspName"/>    
                </td>
            </tr>
<%--            
            <tr>
                <td valign="top" nowrap class="label" width="18%">
                  <bean:message bundle="appCommonRes" key="bp.process.processInstance.description"/>:
                </td>                
                <td valign="top" wrap class="labelField" width="82%">
                  <bean:write  name="processInstanceDetailView" property="description"/>    
                </td>
            </tr>
--%>            
            <tr>
                <td valign="top" nowrap class="label" width="18%">
                  <bean:message bundle="appCommonRes" key="bp.process.processInstance.instanceName"/>:
                </td>
                <td valign="top" nowrap class="labelField" width="82%"> 
                  <bean:write name="processInstanceDetailView" property="customId"/>                                           
                </td>
            </tr>            
            <tr>
                <td valign="top" nowrap class="label" width="18%">
                  <bean:message bundle="appCommonRes" key="bp.process.processInstance.oid"/>:
                </td>                
                <td valign="top" wrap class="labelField" width="82%">
                  <bean:write name="processInstanceDetailView" property="oid"/>   
                </td>
            </tr>
            <tr>
                <td valign="top" nowrap class="label" width="18%">
                  <bean:message bundle="appCommonRes" key="bp.process.processInstance.submitter"/>:
                </td>                
                <td valign="top" wrap class="labelField" width="82%">
                  <bean:write  name="processInstanceDetailView" property="submitter"/>
                </td>
            </tr>
            <tr>
                <td valign="top" nowrap class="label" width="18%">
                  <bean:message bundle="appCommonRes" key="bp.process.processInstance.status"/>:
                </td>
                <td valign="top" nowrap class="labelField" width="82%">
                  <bean:write name="processInstanceDetailView" property="applicationState"/>
                </td>
            </tr>
            <tr>
                <td valign="top" nowrap class="label" width="18%">
                  <bean:message bundle="appCommonRes" key="bp.process.processInstance.workflowState"/>:
                </td>
                <td valign="top" nowrap class="labelField" width="82%">
                  <bean:message bundle="appCommonRes" name="processInstanceDetailView" property="state"/>
                </td>
            </tr>
            <tr>
                <td valign="top" nowrap class="label" width="18%">
                  <bean:message bundle="appCommonRes" key="bp.process.processInstance.startDate"/>:
                </td>                
                <td valign="top" wrap class="labelField" width="82%">
                  <bean:write bundle="appCommonRes" name="processInstanceDetailView" property="startingTime" formatKey="format.datetime.full"/>
                </td>
            </tr>
            <tr>
                <td valign="top" nowrap class="label" width="18%">
                  <bean:message bundle="appCommonRes" key="bp.process.processInstance.dueDate"/>:
                </td>                
                <td valign="top" wrap class="labelField" width="82%">
                  <bean:write bundle="appCommonRes" name="processInstanceDetailView" property="dueDate" formatKey="format.datetime.full"/>
                </td>
            </tr>
            <tr>
                <td valign="top" nowrap class="label" width="18%">
                  <bean:message bundle="appCommonRes" key="bp.process.processInstance.completionDate"/>:
                </td>                
                <td valign="top" wrap class="labelField" width="82%">
                  <bean:write bundle="appCommonRes" name="processInstanceDetailView" property="completionTime" formatKey="format.datetime.full"/>
                </td>
            </tr>
<%--            
            <tr>
                <td valign="top" nowrap class="label" width="18%">
                  <bean:message bundle="appCommonRes" key="bp.process.processInstance.manager"/>:
                </td>                
                <td valign="top" wrap class="labelField" width="82%">
                  <bean:write  name="processInstanceDetailView" property="processManager"/>
                </td>
            </tr>
            <tr>
                <td valign="top" nowrap class="label" width="18%">
                  <bean:message bundle="appCommonRes" key="bp.process.processInstance.processManager"/>:
                </td>
                <td valign="top" nowrap class="labelField" width="82%"> 
                  <bean:write name="processInstanceDetailView" property="manager"/>              
                </td>
            </tr>
--%>
          </table>
					</div>
	        <br>
          <div class="app_pageSubtitle">
            <span class="left">
              <bean:message bundle="appCommonRes" key="cs.collaborationSpace.list"/>
            </span>
          </div>           
          <div class="blockWrap">
					<%-- list of collaboration spaces (begin) --%>
          <table class="dataTable" border="0" cellspacing="1" cellpadding="2" 
                 summary="collaboration spaces list"  width="100%">      
            <tr class="listHeader"> 
              <th id="Name" align="left" width="50%">
                <bean:message bundle="appCommonRes" key="cs.collaborationSpace.name"/>
              </th>    
              <th id="CurrentPhase" align="left" width="30%">
                <bean:message bundle="appCommonRes" key="cs.collaborationSpace.currentPhase"/>
              </th>
              <th id="Status" align="left" width="20%">
                <bean:message bundle="appCommonRes" key="cs.collaborationSpace.status"/>
              </th>
            </tr>                   
            <logic:iterate id="collaborationSpace" name="collaborationSpaceItems" indexId="index">
            <tr class='<%=index.intValue() % 2 == 0 ? "listEven" : "listOdd"%>'>
              <td headers="Name" align="left" width="50%">
                <% if(ctPath.equals("/bvmc") ) { %>
                   <a href="JavaScript:doCollabAction('<bean:write name="collaborationSpace" property="id"/>')" >
                   <bean:write name="collaborationSpace" property="name"/>
                <% } else { %>
                <html:link href="cs/micrositeHome.do" paramId="micrositeId" 
                       paramName="collaborationSpace" paramProperty="id">
                    <bean:write name="collaborationSpace" property="name"/>
                </html:link>
              <% } %>
              </td>       
              <td headers="CurrentPhase" align="left" width="30%">
                <bean:write name="collaborationSpace" property="currentPhaseName"/>              
              </td>
              <td headers="Status" align="left" width="20%">
                <bean:message bundle="appCommonRes" name="collaborationSpace" property="status"/>                 
              </td>
            </tr>          
            </logic:iterate>
            <logic:empty name="collaborationSpaceItems">
              <tr class="listEven">
                <td colspan="3" align="center">
                  <bean:message bundle="appCommonRes" key="bp.process.processInstance.noCollaboration" />
                </td>
              </tr>
            </logic:empty>
          </table>
          <%-- list of collaboration spaces (end) --%>
          </div>
        </td>
      </tr>
    </table>


